package com.yimi.yinhepda.adapter.RecycleAdapter;

import android.content.Context;
import android.view.View;
import com.yimi.yinhepda.R;
import com.pda.ym.base.CommonRecycleAdapter;
import com.pda.ym.base.CommonViewHolder;
import com.yimi.yinhepda.entity.bean.ScanSealSignEntity;
import java.util.List;

/**
 * @author 000432
 * @date 2018/6/5 0005
 */

public class ScanSealSignAdapter extends CommonRecycleAdapter<ScanSealSignEntity> {

  private Context mContext;
  private CommonViewHolder.onItemCommonClickListener mCommonClickListener;

  public ScanSealSignAdapter(Context context, List<ScanSealSignEntity> dataList, CommonViewHolder.onItemCommonClickListener commonClickListener) {
    super(context, dataList, R.layout.adapter_scan_seal_sign_item);
    this.mContext = context;
    this.mCommonClickListener = commonClickListener;
  }

  @Override public void bindData(CommonViewHolder holder, ScanSealSignEntity data, int position) {
    holder.setText(R.id.tv_serialNum, position + 1 + "");
    holder.setText(R.id.tv_sealSignNo, data.getSealSignNo());

    holder.setCommonClickListener(mCommonClickListener);
    View view = holder.getView(R.id.ll_scan_seal_sign_item);
    if (data.isCheck()) {
      view.setBackgroundColor(mContext.getResources().getColor(R.color.yellow));
    } else {
      view.setBackgroundColor(mContext.getResources().getColor(R.color.white));
    }
  }
}
